package ClassWork.Work_01;

import java.util.Scanner;

public class PalindromicNumber {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数字");
        int num = sc.nextInt();
        boolean flag = numberCheck(num);
        if(flag){
            System.out.println(num + "是回文数");
        }else{
            System.out.println(num + "不是回文数");
        }
    }
    public static boolean numberCheck(int num) {
        int n = num, m = 0;
        while(true){
            if(0 == n / 10){
                m = m * 10 + n;
                break;
            }
            m = m * 10 + n % 10;
            n /= 10;
        }
        return m == num;
    }
}
